package com.apes.framework.plugin.event;

/**
 * 功能：ApesEvent Multicaster
 *
 * @author xul
 * @create 2018-02-02 11:16
 */
public interface EventMulticaster {

    /**
     * Add a listener to be notified of all events.
     *
     * @param listener
     *            the listener to add
     */
    void addListener(ApesEventListener<?> listener);

    /**
     * Remove a listener from the notification list.
     *
     * @param listener
     *            the listener to remove
     */
    void removeListener(ApesEventListener<?> listener);

    /**
     * Remove all listeners registered with this multicaster.
     * <p>
     * After a remove call, the multicaster will perform no action on event
     * notification until new listeners are being registered.
     */
    void removeAllListeners();

    /**
     * Multicast the given application event to appropriate listeners.
     *
     * @param event
     *            the event to multicast
     */
    void multicastEvent(ApesEvent event);
}
